//bool, ObjList objs, str OUT reasonText

Hero this;
str form_name;

if(cmdwaiting != "") return false;

if(objs.count != 1) return false;

this = objs[0].AsHero();
if(!.IsValid()) return false;

form_name = this.AsHero().formation;
if (form_name == "")
	form_name = "Front";

if (form_name == cmdparam){
	if(.command == "retreat_notai"){
		reasonText = Translate("Hero retreat !");
		return false;
	}
	if(.command == "retreat_bld_notai"){
		reasonText = Translate("Hero retreat !");
		return false;
	}
	if(.command != "stand_position"){
		if(.HasItem("irage_battle")){
			reasonText = Translate("Hero in battle !");
			return false;
		}
		if(.command == "great_charge"){
			reasonText = Translate("Hero in battle !");
			return false;
		}
	}
	reasonText = "<color 255 255 0>" + Translatef("%s1 formation", form_name) + "<color 255 255 255>";
	reasonText = reasonText + "\n";
	reasonText = reasonText + FormDescription(cmdparam);
	reasonText = reasonText + "\n";
	reasonText = reasonText + Translate("Select new formation");
	return true;
}
return false;
